package br.com.skolar.server;

import java.util.List;

import br.com.skolar.client.Answer;
import br.com.skolar.client.Question;
import br.com.skolar.client.QuestionService;

import com.google.inject.Inject;
import com.google.inject.persist.Transactional;

public class QuestionServiceImpl implements QuestionService {
	@Inject QuestionRepository repository;
	
	@Override
	public List<Question> searchQuestions() {
		return repository.searchQuestions();
	}

	@Override
	@Transactional
	public Question save(Question question) {
		return repository.save(question);
	}

	@Override
	public List<Answer> loadAnswers(Question question) {
		return repository.loadAnswers(question);
	}

	@Override
	@Transactional
	public Answer save(Answer answer) {
		return repository.save(answer);
	}
}